home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / Resources.a < prev    next >
Encoding:
Text File  |  1998-02-12  |  17.1 KB  |  638 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Resources.a
  3. ;
  4. ;    Contains:    Resource Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    Mac OS 8.1
  7. ;                Release:    Universal Interfaces 3.1
  8. ;
  9. ;    Copyright:    © 1985-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__RESOURCES__') = 'UNDEFINED' THEN
  19. __RESOURCES__ SET 1
  20.  
  21.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  22.     include 'MacTypes.a'
  23.     ENDIF
  24.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  25.     include 'MixedMode.a'
  26.     ENDIF
  27.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  28.     include 'Files.a'
  29.     ENDIF
  30.  
  31.  
  32.  
  33. resSysHeap                        EQU        64                    ;System or application heap?
  34. resPurgeable                    EQU        32                    ;Purgeable resource?
  35. resLocked                        EQU        16                    ;Load it in locked?
  36. resProtected                    EQU        8                    ;Protected?
  37. resPreload                        EQU        4                    ;Load in on OpenResFile?
  38. resChanged                        EQU        2                    ;Resource changed?
  39. mapReadOnly                        EQU        128                    ;Resource file read-only
  40. mapCompact                        EQU        64                    ;Compact resource file
  41. mapChanged                        EQU        32                    ;Write map out at update
  42.  
  43. resSysRefBit                    EQU        7                    ;reference to system/local reference
  44. resSysHeapBit                    EQU        6                    ;In system/in application heap
  45. resPurgeableBit                    EQU        5                    ;Purgeable/not purgeable
  46. resLockedBit                    EQU        4                    ;Locked/not locked
  47. resProtectedBit                    EQU        3                    ;Protected/not protected
  48. resPreloadBit                    EQU        2                    ;Read in at OpenResource?
  49. resChangedBit                    EQU        1                    ;Existing resource changed since last update
  50. mapReadOnlyBit                    EQU        7                    ;is this file read-only?
  51. mapCompactBit                    EQU        6                    ;Is a compact necessary?
  52. mapChangedBit                    EQU        5                    ;Is it necessary to write map?
  53.  
  54. kResFileNotOpened                EQU        -1                    ;ref num return as error when opening a resource file
  55. kSystemResFile                    EQU        0                    ;this is the default ref num to the system file
  56.  
  57.     IF ¬ TARGET_OS_MAC THEN
  58. ;  QuickTime 3.0
  59.     ENDIF
  60. ;
  61. ; pascal short InitResources(void )
  62. ;
  63.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  64.         _InitResources:    OPWORD    $A995
  65.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  66.         IMPORT_CFM_FUNCTION InitResources
  67.     ENDIF
  68.  
  69. ;
  70. ; pascal void RsrcZoneInit(void )
  71. ;
  72.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  73.         _RsrcZoneInit:    OPWORD    $A996
  74.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  75.         IMPORT_CFM_FUNCTION RsrcZoneInit
  76.     ENDIF
  77.  
  78. ;
  79. ; pascal void CloseResFile(short refNum)
  80. ;
  81.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  82.         _CloseResFile:    OPWORD    $A99A
  83.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  84.         IMPORT_CFM_FUNCTION CloseResFile
  85.     ENDIF
  86.  
  87. ;
  88. ; pascal OSErr ResError(void )
  89. ;
  90.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  91.         _ResError:    OPWORD    $A9AF
  92.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  93.         IMPORT_CFM_FUNCTION ResError
  94.     ENDIF
  95.  
  96. ;
  97. ; pascal short CurResFile(void )
  98. ;
  99.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  100.         _CurResFile:    OPWORD    $A994
  101.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  102.         IMPORT_CFM_FUNCTION CurResFile
  103.     ENDIF
  104.  
  105. ;
  106. ; pascal short HomeResFile(Handle theResource)
  107. ;
  108.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  109.         _HomeResFile:    OPWORD    $A9A4
  110.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  111.         IMPORT_CFM_FUNCTION HomeResFile
  112.     ENDIF
  113.  
  114. ;
  115. ; pascal void CreateResFile(ConstStr255Param fileName)
  116. ;
  117.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  118.         _CreateResFile:    OPWORD    $A9B1
  119.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  120.         IMPORT_CFM_FUNCTION CreateResFile
  121.     ENDIF
  122.  
  123. ;
  124. ; pascal short OpenResFile(ConstStr255Param fileName)
  125. ;
  126.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  127.         _OpenResFile:    OPWORD    $A997
  128.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  129.         IMPORT_CFM_FUNCTION OpenResFile
  130.     ENDIF
  131.  
  132. ;
  133. ; pascal void UseResFile(short refNum)
  134. ;
  135.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  136.         _UseResFile:    OPWORD    $A998
  137.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  138.         IMPORT_CFM_FUNCTION UseResFile
  139.     ENDIF
  140.  
  141. ;
  142. ; pascal short CountTypes(void )
  143. ;
  144.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  145.         _CountTypes:    OPWORD    $A99E
  146.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  147.         IMPORT_CFM_FUNCTION CountTypes
  148.     ENDIF
  149.  
  150. ;
  151. ; pascal short Count1Types(void )
  152. ;
  153.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  154.         _Count1Types:    OPWORD    $A81C
  155.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  156.         IMPORT_CFM_FUNCTION Count1Types
  157.     ENDIF
  158.  
  159. ;
  160. ; pascal void GetIndType(ResType *theType, short index)
  161. ;
  162.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  163.         _GetIndType:    OPWORD    $A99F
  164.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  165.         IMPORT_CFM_FUNCTION GetIndType
  166.     ENDIF
  167.  
  168. ;
  169. ; pascal void Get1IndType(ResType *theType, short index)
  170. ;
  171.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  172.         _Get1IndType:    OPWORD    $A80F
  173.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  174.         IMPORT_CFM_FUNCTION Get1IndType
  175.     ENDIF
  176.  
  177. ;
  178. ; pascal void SetResLoad(Boolean load)
  179. ;
  180.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  181.         _SetResLoad:    OPWORD    $A99B
  182.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  183.         IMPORT_CFM_FUNCTION SetResLoad
  184.     ENDIF
  185.  
  186. ;
  187. ; pascal short CountResources(ResType theType)
  188. ;
  189.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  190.         _CountResources:    OPWORD    $A99C
  191.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  192.         IMPORT_CFM_FUNCTION CountResources
  193.     ENDIF
  194.  
  195. ;
  196. ; pascal short Count1Resources(ResType theType)
  197. ;
  198.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  199.         _Count1Resources:    OPWORD    $A80D
  200.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  201.         IMPORT_CFM_FUNCTION Count1Resources
  202.     ENDIF
  203.  
  204. ;
  205. ; pascal Handle GetIndResource(ResType theType, short index)
  206. ;
  207.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  208.         _GetIndResource:    OPWORD    $A99D
  209.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  210.         IMPORT_CFM_FUNCTION GetIndResource
  211.     ENDIF
  212.  
  213. ;
  214. ; pascal Handle Get1IndResource(ResType theType, short index)
  215. ;
  216.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  217.         _Get1IndResource:    OPWORD    $A80E
  218.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  219.         IMPORT_CFM_FUNCTION Get1IndResource
  220.     ENDIF
  221.  
  222. ;
  223. ; pascal Handle GetResource(ResType theType, short theID)
  224. ;
  225.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  226.         _GetResource:    OPWORD    $A9A0
  227.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  228.         IMPORT_CFM_FUNCTION GetResource
  229.     ENDIF
  230.  
  231. ;
  232. ; pascal Handle Get1Resource(ResType theType, short theID)
  233. ;
  234.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  235.         _Get1Resource:    OPWORD    $A81F
  236.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  237.         IMPORT_CFM_FUNCTION Get1Resource
  238.     ENDIF
  239.  
  240. ;
  241. ; pascal Handle GetNamedResource(ResType theType, ConstStr255Param name)
  242. ;
  243.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  244.         _GetNamedResource:    OPWORD    $A9A1
  245.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  246.         IMPORT_CFM_FUNCTION GetNamedResource
  247.     ENDIF
  248.  
  249. ;
  250. ; pascal Handle Get1NamedResource(ResType theType, ConstStr255Param name)
  251. ;
  252.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  253.         _Get1NamedResource:    OPWORD    $A820
  254.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  255.         IMPORT_CFM_FUNCTION Get1NamedResource
  256.     ENDIF
  257.  
  258. ;
  259. ; pascal void LoadResource(Handle theResource)
  260. ;
  261.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  262.         _LoadResource:    OPWORD    $A9A2
  263.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  264.         IMPORT_CFM_FUNCTION LoadResource
  265.     ENDIF
  266.  
  267. ;
  268. ; pascal void ReleaseResource(Handle theResource)
  269. ;
  270.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  271.         _ReleaseResource:    OPWORD    $A9A3
  272.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  273.         IMPORT_CFM_FUNCTION ReleaseResource
  274.     ENDIF
  275.  
  276. ;
  277. ; pascal void DetachResource(Handle theResource)
  278. ;
  279.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  280.         _DetachResource:    OPWORD    $A992
  281.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  282.         IMPORT_CFM_FUNCTION DetachResource
  283.     ENDIF
  284.  
  285. ;
  286. ; pascal short UniqueID(ResType theType)
  287. ;
  288.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  289.         _UniqueID:    OPWORD    $A9C1
  290.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  291.         IMPORT_CFM_FUNCTION UniqueID
  292.     ENDIF
  293.  
  294. ;
  295. ; pascal short Unique1ID(ResType theType)
  296. ;
  297.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  298.         _Unique1ID:    OPWORD    $A810
  299.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  300.         IMPORT_CFM_FUNCTION Unique1ID
  301.     ENDIF
  302.  
  303. ;
  304. ; pascal short GetResAttrs(Handle theResource)
  305. ;
  306.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  307.         _GetResAttrs:    OPWORD    $A9A6
  308.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  309.         IMPORT_CFM_FUNCTION GetResAttrs
  310.     ENDIF
  311.  
  312. ;
  313. ; pascal void GetResInfo(Handle theResource, short *theID, ResType *theType, Str255 name)
  314. ;
  315.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  316.         _GetResInfo:    OPWORD    $A9A8
  317.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  318.         IMPORT_CFM_FUNCTION GetResInfo
  319.     ENDIF
  320.  
  321. ;
  322. ; pascal void SetResInfo(Handle theResource, short theID, ConstStr255Param name)
  323. ;
  324.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  325.         _SetResInfo:    OPWORD    $A9A9
  326.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  327.         IMPORT_CFM_FUNCTION SetResInfo
  328.     ENDIF
  329.  
  330. ;
  331. ; pascal void AddResource(Handle theData, ResType theType, short theID, ConstStr255Param name)
  332. ;
  333.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  334.         _AddResource:    OPWORD    $A9AB
  335.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  336.         IMPORT_CFM_FUNCTION AddResource
  337.     ENDIF
  338.  
  339. ;
  340. ; pascal long GetResourceSizeOnDisk(Handle theResource)
  341. ;
  342.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  343.         _GetResourceSizeOnDisk:    OPWORD    $A9A5
  344.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  345.         IMPORT_CFM_FUNCTION GetResourceSizeOnDisk
  346.     ENDIF
  347.  
  348. ;
  349. ; pascal long GetMaxResourceSize(Handle theResource)
  350. ;
  351.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  352.         _GetMaxResourceSize:    OPWORD    $A821
  353.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  354.         IMPORT_CFM_FUNCTION GetMaxResourceSize
  355.     ENDIF
  356.  
  357. ;
  358. ; pascal long RsrcMapEntry(Handle theResource)
  359. ;
  360.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  361.         _RsrcMapEntry:    OPWORD    $A9C5
  362.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  363.         IMPORT_CFM_FUNCTION RsrcMapEntry
  364.     ENDIF
  365.  
  366. ;
  367. ; pascal void SetResAttrs(Handle theResource, short attrs)
  368. ;
  369.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  370.         _SetResAttrs:    OPWORD    $A9A7
  371.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  372.         IMPORT_CFM_FUNCTION SetResAttrs
  373.     ENDIF
  374.  
  375. ;
  376. ; pascal void ChangedResource(Handle theResource)
  377. ;
  378.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  379.         _ChangedResource:    OPWORD    $A9AA
  380.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  381.         IMPORT_CFM_FUNCTION ChangedResource
  382.     ENDIF
  383.  
  384. ;
  385. ; pascal void RemoveResource(Handle theResource)
  386. ;
  387.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  388.         _RemoveResource:    OPWORD    $A9AD
  389.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  390.         IMPORT_CFM_FUNCTION RemoveResource
  391.     ENDIF
  392.  
  393. ;
  394. ; pascal void UpdateResFile(short refNum)
  395. ;
  396.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  397.         _UpdateResFile:    OPWORD    $A999
  398.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  399.         IMPORT_CFM_FUNCTION UpdateResFile
  400.     ENDIF
  401.  
  402. ;
  403. ; pascal void WriteResource(Handle theResource)
  404. ;
  405.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  406.         _WriteResource:    OPWORD    $A9B0
  407.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  408.         IMPORT_CFM_FUNCTION WriteResource
  409.     ENDIF
  410.  
  411. ;
  412. ; pascal void SetResPurge(Boolean install)
  413. ;
  414.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  415.         _SetResPurge:    OPWORD    $A993
  416.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  417.         IMPORT_CFM_FUNCTION SetResPurge
  418.     ENDIF
  419.  
  420. ;
  421. ; pascal short GetResFileAttrs(short refNum)
  422. ;
  423.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  424.         _GetResFileAttrs:    OPWORD    $A9F6
  425.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  426.         IMPORT_CFM_FUNCTION GetResFileAttrs
  427.     ENDIF
  428.  
  429. ;
  430. ; pascal void SetResFileAttrs(short refNum, short attrs)
  431. ;
  432.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  433.         _SetResFileAttrs:    OPWORD    $A9F7
  434.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  435.         IMPORT_CFM_FUNCTION SetResFileAttrs
  436.     ENDIF
  437.  
  438. ;
  439. ; pascal short OpenRFPerm(ConstStr255Param fileName, short vRefNum, SInt8 permission)
  440. ;
  441.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  442.         _OpenRFPerm:    OPWORD    $A9C4
  443.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  444.         IMPORT_CFM_FUNCTION OpenRFPerm
  445.     ENDIF
  446.  
  447. ;
  448. ; pascal Handle RGetResource(ResType theType, short theID)
  449. ;
  450.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  451.         _RGetResource:    OPWORD    $A80C
  452.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  453.         IMPORT_CFM_FUNCTION RGetResource
  454.     ENDIF
  455.  
  456. ;    Note:     The HOpenResFile trap was not implemented until System 7.  If you want to call HOpenResFile
  457. ;            while running on System 6 machines, then define USE_HOPENRESFILE_GLUE and link with
  458. ;            Interface.o which contains glue to implement HOpenResFile on pre-System 7 machines.
  459. ;
  460.  
  461.     IF &TYPE('USE_HOPENRESFILE_GLUE') <> 'UNDEFINED' THEN
  462. ;
  463. ; pascal short HOpenResFile(short vRefNum, long dirID, ConstStr255Param fileName, SInt8 permission)
  464. ;
  465.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  466.         IMPORT_CFM_FUNCTION HOpenResFile
  467.     ENDIF
  468.  
  469.     ELSE
  470. ;
  471. ; pascal short HOpenResFile(short vRefNum, long dirID, ConstStr255Param fileName, SInt8 permission)
  472. ;
  473.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  474.         _HOpenResFile:    OPWORD    $A81A
  475.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  476.         IMPORT_CFM_FUNCTION HOpenResFile
  477.     ENDIF
  478.  
  479.     ENDIF
  480. ;    Note:     The HCreateResFile trap was not implemented until System 7.  If you want to call HCreateResFile
  481. ;            while running on System 6 machines, then define USE_HCREATERESFILE_GLUE and link with
  482. ;            Interface.o which contains glue to implement HCreateResFile on pre-System 7 machines.
  483. ;
  484.  
  485.     IF &TYPE('USE_HCREATERESFILE_GLUE') <> 'UNDEFINED' THEN
  486. ;
  487. ; pascal void HCreateResFile(short vRefNum, long dirID, ConstStr255Param fileName)
  488. ;
  489.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  490.         IMPORT_CFM_FUNCTION HCreateResFile
  491.     ENDIF
  492.  
  493.     ELSE
  494. ;
  495. ; pascal void HCreateResFile(short vRefNum, long dirID, ConstStr255Param fileName)
  496. ;
  497.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  498.         _HCreateResFile:    OPWORD    $A81B
  499.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  500.         IMPORT_CFM_FUNCTION HCreateResFile
  501.     ENDIF
  502.  
  503.     ENDIF
  504. ;
  505. ; pascal short FSpOpenResFile(const FSSpec *spec, SignedByte permission)
  506. ;
  507.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  508.         Macro
  509.         _FSpOpenResFile
  510.             moveq               #13,D0
  511.             dc.w                $AA52
  512.         EndM
  513.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  514.         IMPORT_CFM_FUNCTION FSpOpenResFile
  515.     ENDIF
  516.  
  517. ;
  518. ; pascal void FSpCreateResFile(const FSSpec *spec, OSType creator, OSType fileType, ScriptCode scriptTag)
  519. ;
  520.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  521.         Macro
  522.         _FSpCreateResFile
  523.             moveq               #14,D0
  524.             dc.w                $AA52
  525.         EndM
  526.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  527.         IMPORT_CFM_FUNCTION FSpCreateResFile
  528.     ENDIF
  529.  
  530. ;
  531. ; pascal void ReadPartialResource(Handle theResource, long offset, void *buffer, long count)
  532. ;
  533.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  534.         Macro
  535.         _ReadPartialResource
  536.             moveq               #1,D0
  537.             dc.w                $A822
  538.         EndM
  539.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  540.         IMPORT_CFM_FUNCTION ReadPartialResource
  541.     ENDIF
  542.  
  543. ;
  544. ; pascal void WritePartialResource(Handle theResource, long offset, const void *buffer, long count)
  545. ;
  546.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  547.         Macro
  548.         _WritePartialResource
  549.             moveq               #2,D0
  550.             dc.w                $A822
  551.         EndM
  552.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  553.         IMPORT_CFM_FUNCTION WritePartialResource
  554.     ENDIF
  555.  
  556. ;
  557. ; pascal void SetResourceSize(Handle theResource, long newSize)
  558. ;
  559.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  560.         Macro
  561.         _SetResourceSize
  562.             moveq               #3,D0
  563.             dc.w                $A822
  564.         EndM
  565.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  566.         IMPORT_CFM_FUNCTION SetResourceSize
  567.     ENDIF
  568.  
  569. ;
  570. ; pascal Handle GetNextFOND(Handle fondHandle)
  571. ;
  572.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  573.         Macro
  574.         _GetNextFOND
  575.             moveq               #10,D0
  576.             dc.w                $A822
  577.         EndM
  578.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  579.         IMPORT_CFM_FUNCTION GetNextFOND
  580.     ENDIF
  581.  
  582.  
  583.     IF ¬ TARGET_OS_MAC THEN
  584. ;  QuickTime 3.0
  585. ;
  586. ; extern OSErr RegisterResourceEndianFilter(ResType theType, ResourceEndianFilterPtr theFilterProc)
  587. ;
  588.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  589.         IMPORT_CFM_FUNCTION RegisterResourceEndianFilter
  590.     ENDIF
  591.  
  592.     ENDIF
  593. ;  Use TempInsertROMMap to force the ROM resource map to be
  594. ;   inserted into the chain in front of the system. Note that
  595. ;   this call is only temporary - the modified resource chain
  596. ;   is only used for the next call to the resource manager.
  597. ;   See IM IV 19 for more information. 
  598. ;
  599.  
  600. ;
  601. ; pascal void TempInsertROMMap(Boolean tempResLoad)
  602. ;
  603.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  604.         Macro
  605.         _TempInsertROMMap
  606.             moveq               #-1,D0
  607.             dc.w                $4A1F
  608.             dc.w                $56C0
  609.             dc.w                $31C0
  610.             dc.w                $0B9E
  611.         EndM
  612.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  613.         IMPORT_CFM_FUNCTION TempInsertROMMap
  614.     ENDIF
  615.  
  616.  
  617.     IF OLDROUTINENAMES THEN
  618.  
  619.     ENDIF    ; OLDROUTINENAMES
  620. ;    These typedefs were originally created for the Copland Resource Mangager
  621. ;
  622.  
  623. ; typedef short                         ResFileRefNum
  624.  
  625. ; typedef short                         ResID
  626.  
  627. ; typedef short                         ResAttributes
  628.  
  629. ; typedef short                         ResFileAttributes
  630.  
  631.  
  632.  
  633.     ENDIF ; __RESOURCES__ 
  634.  
  635.